package com.ddyx.rest;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

@Controller
@RequestMapping("/activepage")
public class ActivePageController {
	
	@RequestMapping("/list")
	public String active() {
		
		System.out.println("=================activelist================");
		return "/active/activelist";
	}
	
	@RequestMapping("/test")
	@ResponseBody
	public String testDemo() throws Exception {
		Map map = new HashMap();
		map.put("1", 1);
		map.put("2", 2);
		ObjectMapper jsonUtil = new ObjectMapper();
		String json = jsonUtil.writeValueAsString(map);
		return json;
	}
}
